<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        th{
            text-align: left;
            font-size: 14px;
            border-bottom: solid #aaa 2px;
        }
        td{
            text-align: left;
            font-size: 12px;
            border-bottom: solid #aaa 1px;
        }
        h5{
            padding-left: 10px;
        }
    </style>
</head>

<body>
    <script>
        function getQueryString(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
            var r = window.location.search.substr(1).match(reg);
            if (r != null) {
                return unescape(r[2]);
            }
            return null;
        }

        var info = getQueryString('i')?JSON.parse(getQueryString('i')):null;

        if(info!=null){
            document.write('<div style="width:281px;border:solid 1px #ccc;padding:0px 10px;">');
            document.write('<h3 style="text-align:center">菜菜帮</h3>');
            document.write('<table style="padding:0;margin:0;width:100%;"><tbody>');
            document.write('<tr><td width="80">用户：</td><td>'+info.n+'</td></tr>');
            document.write('<tr><td>当前余额：</td><td>'+info.b+'元</td></tr>');    
            document.write('<tr><td>本次充值：</td><td>'+info.ib+'元</td></tr>');       
            document.write('<tr><td>充值前余额：</td><td>'+info.bb+'元</td></tr>');
            document.write('</tbody></table>');

            document.write('</div">');

        } else {
            alert('打印错误')
        }

    </script>
</body>

</html>